import * as tslib_1 from "tslib";
import { observable, action } from "mobx";
import request from "../utils/request";
import * as api from "../api/api";
import { LoadHoc, loading } from "../hoc/loadHoc";
let SignStore = class SignStore extends LoadHoc {
  constructor() {
    super(...arguments);
    /**
     * 获取用户签到记录
     */
    this.userSignRecord = {};
    /**
     * 获取用户签到文章
     */
    this.signedArticle = {};
  }
  async getUserSignRecord(params) {
    const { callback } = params;
    const userSignRecord = await request(api.AppsignApiFetchParamCreactor.appsignGetUserSignRecordAsync({}));
    this.userSignRecord = userSignRecord;
    callback && callback(userSignRecord);
  }
  /**
   * 签到
   */
  async sign(params) {
    const { callback } = params;
    const res = await request(api.AppsignApiFetchParamCreactor.appsignSignAsync({}));
    callback && callback(res);
  }
  async getSignedArticle(params) {
    const { callback } = params;
    const signedArticle = await request(api.AppsignApiFetchParamCreactor.appsignGetSignedArticleAsync({}));
    this.signedArticle = signedArticle;
    callback && callback(signedArticle);
  }
};
export { SignStore as default };

tslib_1.__decorate([observable], SignStore.prototype, "userSignRecord", undefined);
tslib_1.__decorate([loading, action], SignStore.prototype, "getUserSignRecord", null);
tslib_1.__decorate([loading, action], SignStore.prototype, "sign", null);
tslib_1.__decorate([observable], SignStore.prototype, "signedArticle", undefined);
tslib_1.__decorate([loading, action], SignStore.prototype, "getSignedArticle", null);